/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

import java.util.Random;

/**
 * <p>Project: jse2303 - Output2
 * <p>Powered by webrx On 2023-07-11 09:36:02
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Output2 {
    public static void main(String[] args) {
        System.out.println("\33[43;31mhelloworld\33[0m");
        //输出控制颜色 软件虚拟颜色 30 - 39 前景色  40 - 49 背景色
        for (int i = 30; i < 39; i++) {
            System.out.printf("hello \33[%dm%<djava\33[0m%n", i);
        }

        for (int i = 40; i < 49; i++) {
            System.out.printf("hello \33[%d;31m%<djava\33[0m%n", i);
        }

        Random rand = new Random();
        for (int i = 0; i < 50; i++) {
            if (i % 5 == 0 && i > 0) System.out.println("\r\n");
            int bg = rand.nextInt(41, 49);
            int fg = rand.nextInt(31, 39);
            int ss = rand.nextInt(1, 5);
            System.out.printf("\33[%d;%d;%dmhellojava\33[0m    ", bg, fg, ss);
        }

    }
}
